package com.itheima.test;

public class Demo_017 {
    private static long[] arr = new long[61];

    public static void main(String[] args) {
        //long l = System.currentTimeMillis();
        long result = method(60);
        System.out.println(result);
        //long l1 = System.currentTimeMillis();
        //System.out.println(l1 - l);
    }

    private static long method(int i) {
        if (i == 1 || i == 2) {
            return 1;
        }
        long temp = arr[i];
        if(temp != 0){
            return temp;
        }
        long t = method(i-1)+method(i-2);
        arr[i]= t;
        return t;

    }
}
